"""
    secret_settings.py
    生产环境配置项(必须)
"""
from envcrypto import get_environ, set_environ

##########
# CORE
##########

# 基础密钥, 用于加密其他敏感数据 (可任意数据类型, 任意长度, 默认从环境变量中解密获得)
SECRET_KEY = WTF_CSRF_SECRET_KEY = get_environ('PYADMIN_SECRET_KEY', '我是仅用于解密SECRET_KEY的KEY')

##########
# OAuth2
##########

# 正式环境的 OAuth 配置
OA_CLIENT_ID = 'ffpy123glfxxxdabci3loln1xunyouff'
OA_CLIENT_SECRET = get_environ('PYADMIN_OAUTH_SECRET', key=SECRET_KEY)
OA_API_BASE_URL = 'http://oa.xxx.com/oauth2/'
OA_AUTHORIZE_URL = 'http://oa.xxx.com/oauth2/authorize/'
OA_ACCESS_TOKEN_URL = 'http://oa.xxx.com/oauth2/access_token/'
OA_REFRESH_TOKEN_URL = 'http://oa.xxx.com/oauth2/refresh_token/'
# 允许 HTTP
set_environ('AUTHLIB_INSECURE_TRANSPORT', '1')

##########
# DB
##########

SQLALCHEMY_DATABASE_URI = 'mysql+cymysql://root:admin@127.0.0.1:3306' \
                          '/db_ff_pyadmin?charset=utf8mb4'
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_ENGINE_OPTIONS = {
    'pool_recycle': 3599,
    'pool_size': 100,
    'max_overflow': -1,
}

##########
# Mail
##########

MAIL_OPEN = False
MAIL_SERVER = 'smtp.qq.com'
MAIL_PROT = 465
MAIL_USE_TLS = True
MAIL_USERNAME = 'yfufuok@qq.com'
MAIL_PASSWORD = ''
MAIL_DEFAULT_SENDER = 'yfufuok@qq.com'
